import request from '@/utils/request'
import querystring from 'querystring'



/**
 * 会员卡新增接口
 * @param {*} param 
 */
export function addLevel(param) {
  return request.post('/member/save', param)
}

/**
 * 修改接口
 * @param {*} param 
 */
export function updateLevel(param) {
  return request.put('/member/save', param)
}
/**
 * 获取会员卡详情
 * @param {*} id 
 */
export function memberdetail(id) {
  return request.get(`/member/detail/${id}`)
}
/**
 * 获取会员卡权益详情
 * @param {*} id 
 */
export function equitiesDetail(id) {
  return request.get(`member/equities/detail/${id}`)
}


/**
 * 会员卡权益
 * @param {*} param 
 * @param {*} pageSize 
 * @param {*} pageNo 
 */
export function equitiesPage(param, pageSize, pageNo) {
  const data = {
    pageNo,
    pageSize,
    param: {
      ...param
    }
  }
  return request.post('/member/equities/page', data)
}
/**
 * 会员卡分页查询
 * @param {*} param 
 * @param {*} pageSize 
 * @param {*} pageNo 
 */
export function levelList(param, pageSize, pageNo) {
  const data = {
    pageNo,
    pageSize,
    param: {
      ...param
    }
  }
  return request.post('/member/page', data)
}

/**
 * 权益新增接口
 * @param {*} param 
 */
export function equitiesSave(param) {
  return request.post('/member/equities/save', param)
}
/**
 * 权益修改接口
 * @param {*} param 
 */
export function equitiesUpdate(param) {
  return request.put(`/member/equities/update`,param)
}


export function deletelevel(id) {
  return request.delete('/client/del/' + id)
}


export function updateClient(param) {
  return request.post('/client/editSave', param)
}
export function getClientDict() {
  return request.get('/platform/customer/dict')
}

export function getClients() {
  return request.get('/platform/customer/allCustomer')
}

export function getClientById(id) {
  return request.get('/client/detail/' + id)
}



